//
//  WCNSwitchSexTCell.m
//  WCN
//
//  Created by 杨鑫 on 15/7/2.
//  Copyright (c) 2015年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCNSwitchSexTCell.h"

@interface WCNSwitchSexTCell ()

@property (weak, nonatomic) IBOutlet UIButton *sexSwitchBtn;
@property (weak, nonatomic) IBOutlet UILabel *sexLabel;

@end

@implementation WCNSwitchSexTCell

- (void)setSex:(BOOL)isMale
{
    if (!isMale) {
        self.sexLabel.text = @"男";
        self.sexSwitchBtn.selected = NO;
    } else {
        self.sexLabel.text = @"女";
        self.sexSwitchBtn.selected = YES;
    }
}

- (IBAction)sexSwitch:(id)sender {
    UIButton *btn = sender;
    btn.selected = !btn.selected;
//    self.sexLabel.text = btn.selected?@"女":@"男";
//    self.sexValueChange(btn.selected);
    if (!btn.selected) {
        self.sexLabel.text = @"男";
//        btn.selected = NO;
        
        self.sexValueChange(NO);
    } else {
        self.sexLabel.text = @"女";
//        btn.selected = YES;
        
        self.sexValueChange(YES);
    }
}

@end
